/*
 * @Author: weikang
 * @Description:
 * @Date: 2023-12-22 12:02:54
 * @LastEditTime: 2023-12-23 18:24:54
 * @FilePath: \env-manager-pc\src\router\modules\system.ts
 */
import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/system',
  component: Layout,
  redirect: '/system/access',
  name: 'system',
  meta: {
    title: '系统管理',
    icon: 'ep:setting',
  },
  children: [
    {
      path: 'accessForOwnerOrg',
      name: 'system-access-OwnerOrg',
      component: () => import('@/views/system/access/index.vue'),
      meta: {
        title: '运维公司账号管理',
        auth: '/system/accessForOwnerOrg',
      },
    },
    {
      path: 'accessForEnvOrg',
      name: 'system-access-EnvOrg',
      component: () => import('@/views/system/access/index.vue'),
      meta: {
        title: '环保局账号管理',
        auth: '/system/accessForEnvOrg',
      },
    },
    {
      path: 'accessForEnterpris',
      name: 'system-access-Enterpris',
      component: () => import('@/views/system/access/index.vue'),
      meta: {
        title: '企业账号管理',
        auth: '/system/accessForEnterpris',
      },
    },
    {
      path: 'role',
      name: 'system-role',
      component: () => import('@/views/system/role/index.vue'),
      meta: {
        title: '角色管理',
        auth: '/system/role',
      },
    },
    {
      path: 'config',
      name: 'system-config',
      component: () => import('@/views/system/config/index.vue'),
      meta: {
        title: '配置管理',
      },
      children: [
        {
          path: 'ownerOrg',
          name: 'config-ownerOrg',
          component: () => import('@/views/system/config/index.vue'),
          meta: {
            title: '运维公司管理',
            auth: '/system/config/ownerOrg',
          },
        },
        {
          path: 'envOrgs',
          name: 'config-envOrgs',
          component: () => import('@/views/system/config/index.vue'),
          meta: {
            title: '环保局管理',
            auth: '/system/config/envOrgs',
          },
        },
      ],
    },
  ],
}

export default routes
